<template >
    <div>
        <!-- 面包屑 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/menu/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/menu/">权限管理</a></el-breadcrumb-item>
            <el-breadcrumb-item>权限列表</el-breadcrumb-item>
        </el-breadcrumb>
        <!-- 卡片 -->
        <el-card class="box-card">
            <!-- 表格 -->
            <template>
                <el-table :data="tableData" border style="width: 100%">
                    <el-table-column type="index" label="#">
                    </el-table-column>
                    <el-table-column prop="authName" label="权限名称">
                    </el-table-column>
                    <el-table-column prop="path" label="路径">
                    </el-table-column>
                    <el-table-column prop="level" label="等级">
                        <template slot-scope="scope"> 
                            <el-tag type="primary" v-show="scope.row.level == 0"  plain disabled>一级</el-tag>
                            <el-tag type="success" v-show="scope.row.level == 1"  plain disabled>二级</el-tag>
                            <el-tag type="danger"  v-show="scope.row.level == 2"  plain disabled>三级</el-tag> 
                        </template>
                    </el-table-column>
                </el-table>
            </template>
        </el-card>
    </div>
</template>
<script>
export default {
    data() {
        return {
            tableData: [],
        }
    },
    mounted(){
        this.getlist()
    },
    methods:{
       async getlist(){
        var res = await this.axios({
            url:'/v1/rights/list',
          
        })
        console.log(res);
        this.tableData =res.data.data
       }
    }
}
</script>
<style >
.box-card {
    width: 100%;
    margin-top: .9375rem;
}
</style>